import Title from '@/components/Title'
import { Trim,setStore,getStore,removeStore } from "@/utils/util"
export default {
	data() {
		return {
			order:{},
			passengers:null,
			logs:null		
		}
	},
	computed: {
		
	},
	watch:{
		
	},
	methods: {
		getOrder(){
			let orderNumber = this.$route.query.orderNumber;
			this.$http.get(`/order/orderDetail/${orderNumber}`)
				.then((res) => {
					const success = res.data.success;
					if(success){
						this.order = res.data.obj;
						return;
					}
					this.$message('订单信息获取失败');
				})
		},
		getPassenger(){
			let orderNumber = this.$route.query.orderNumber;
			this.$http.get(`/order/queryPassenger/${orderNumber}`)
				.then((res) => {
					const rows = res.data.rows;
					if(rows){
						this.passengers = rows;
						return;
					}
					this.$message('乘客信息获取失败');
				})
		},
		getLog(){
			let orderNumber = this.$route.query.orderNumber;
			this.$http.get(`/order/orderLogAndRemark/${orderNumber}`)
				.then((res) => {				
					if(res.data){
						this.logs = res.data;
						return;
					}
					this.$message('获取日志信息失败');
				})
		},
	},
	components:{
		Title,
	},
	created() {
		this.getOrder();
		this.getPassenger();
		this.getLog();
	}
}